<template>
  <div>
    <el-card class="box-card">
      <el-avatar
        src="https://cube.elemecdn.com/0/88/03b0d39583f48206768a7534e55bcpng.png"
      ></el-avatar>
      <el-row class="HappyEveryDay">
        <el-col :span="24"
          ><div class="grid-content bg-purple-dark">
            {{ time }} {{ userList.username }}, 祝你开心每一天
          </div>
        </el-col>
        <span class="position"
          >{{ user.username }} | {{ userList.departmentName }}</span
        >
      </el-row>
    </el-card>

    <el-row type="flex" :gutter="10">
      <el-col :span="14" class="left-box">
        <el-card>
          <el-calendar v-model="my_deta" class="date-item"></el-calendar>
        </el-card>
        <el-card>
        
        </el-card>
      </el-col>

      <el-col :span="10">
        <el-card>
          <el-calendar
            v-model="my_deta"
          ></el-calendar> </el-card
      ></el-col>
    </el-row>
  </div>
</template>

<script>
import { mapState, mapActions } from 'vuex'
export default {
  data() {
    return {
      my_deta: new Date()
    }
  },
  mounted() {},
  computed: {
    ...mapState('homePage', ['userList']),
    ...mapState(['user']),
    time() {
      console.log('userlist', this.userList)
      // console.log('user', this.user)
      const now = new Date()
      const hour = now.getHours()
      if (hour < 6) {
        return '凌晨好！'
      } else if (hour < 9) {
        return '早上好！'
      } else if (hour < 12) {
        return '上午好！'
      } else if (hour < 14) {
        return '中午好！'
      } else if (hour < 17) {
        return '下午好！'
      } else if (hour < 19) {
        return '傍晚好！'
      } else if (hour < 22) {
        return '晚上好！'
      } else {
        return '夜里好！'
      }
    }
  },
  methods: {}
}
</script>

<style scope lang='less'>
.box-card {
  position: relative;
  margin-bottom: 20px;
  .el-avatar {
    width: 110px;
    height: 110px;
    display: inline-block;
  }
  .HappyEveryDay {
    display: inline-block;
    line-height: 110px;
    margin: 0 10px 20px;
    top: 0;
    left: 0;
    font-size: 24px;
    &:last-child {
      margin-bottom: 0;
    }
  }
  .position {
    position: absolute;
    height: 30px;
    bottom: 40%;
    left: 0;
    font-size: 18px;
    color: #7f8c8d;
  }
}
.el-col {
  border-radius: 4px;
}

.grid-content {
  border-radius: 4px;
  min-height: 36px;
}
.left-box {
 
 
}
</style>